"""
#作者：cacho_37967865
#博客：https://blog.csdn.net/sinat_37967865
#文件：surya-ocr_model.py
#日期：2025-05-09
#备注：文字识别
pip install surya-ocr python>3.9
"""

from PIL import Image
from surya.recognition import RecognitionPredictor
from surya.detection import DetectionPredictor


image = Image.open("F:\\PythonProject\\604B-2.jpg")
lang = ["en"] # Replace with your languages or pass None (recommended to use None)
recognition_predictor = RecognitionPredictor()
detection_predictor = DetectionPredictor()

predictions = recognition_predictor([image], [lang], detection_predictor)

print(predictions)





